package net.risesoft.risebi.collection.service.impl;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.*;

import net.risesoft.risebi.collection.dao.ReportInstanceDao;
import net.risesoft.risebi.collection.dao.ReportInstanceR6Dao;
import net.risesoft.risebi.collection.model.*;
import net.risesoft.risebi.collection.service.*;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.appfuse.dao.Dao;
import org.appfuse.service.impl.BaseManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * 
 * 
 * @author <a href="mailto: baiyibing@gmail.com">王锤</a>
 * @version $Revision$
 * 
 */
@Repository(value = "reportInstanceManagerR6")
@Transactional(rollbackFor = { java.lang.Exception.class })
public class ReportInstanceManagerR6Impl extends ReportInstanceManagerImpl  implements ReportInstanceManagerR6{

	private ReportInstanceR6Dao reportInstanceR6Dao;
	
   
	@Override
	public ReportInstance getR6Object(String reportTaskID, Serializable id) {
		// TODO Auto-generated method stub
		ReportInstanceR6 r6 =  this.getReportInstanceR6Dao().getObject(reportTaskID, id);
	    ReportInstance r7 = new ReportInstance();
	    r7.setGuid(r6.getReportID());
	    r7.setTemplate(new Template());r7.getTemplate().setGuid(r6.getTemplate_guid());       
	    //从数据库中取出来的ReportInstance可以设置上reportTaskID，但是到页面上去了之后没有这个变量了，需要进一步修改丁总那边的定义程序包括JSP代码和java代码
	    r7.setApplication(new Application());r7.getApplication().setGuid(reportTaskID);
		return r7;
	}

	public ReportInstanceR6Dao getReportInstanceR6Dao() {
		return reportInstanceR6Dao;
	}
	@Autowired
	public void setReportInstanceR6Dao(ReportInstanceR6Dao reportInstanceR6Dao) {
		this.reportInstanceR6Dao = reportInstanceR6Dao;
	}



}